package com.ll.homework;

/**
 * @author 刘龙
 * @version 1.0
 */
public class Homework07 {
    public static void main(String[] args) {
        Car car = new Car(-1);
        car.getAir().flow();

        new Car(60).new Air().flow();
    }
}

class Car {
    private double temperature;

    public Car(double temperature) {
        this.temperature = temperature;
    }

    class Air {
        public void flow() {
            if (temperature > 40) {
                System.out.println("冷气");
            } else if(temperature < 0) {
                System.out.println("暖气");
            } else {
                System.out.println("关闭空调");
            }
        }
    }

    public Air getAir() {
        return new Air();
    }
}


